package design.principles.ocp;

public class JavaDiscountCource extends JavaCource{
    public JavaDiscountCource(Integer id, String name, Double price) {
        super(id, name, price);
    }
    //打折前的价格，即原始价格
    public Double getOriginPrice(){
        return super.getPrice();
    }
    //打折后的价格
    public Double getPrice(double discount) {
        return super.getPrice()*discount;
    }

}
